// @import (less) 'reference-btn.less';
.btn-reset(){
  .c3p(box-sizing,border-box);//ie8以后对btn都支持
  font-size:inherit;
  text-align:center;vertical-align:middle;
  cursor: pointer;
  &.disabled,&:disabled{
    cursor: not-allowed;
  }
}

.btn-color(auto,@bgc,@ftc,@brc){
  @isGray:boolean(
    ( red(@bgc) = green(@bgc) )
    and ( green(@bgc) = blue(@bgc) )
    and ( blue(@bgc) = red(@bgc) )
  );
  @isLight:boolean( (luma(@bgc) > 50%) );
  @fc:if( (@isGray and @isLight),@ftc,#fff );
  @bc:if( (@isGray or @isLight),@fc,@brc );
  &{
    border-color:@bc;
    background-color:@bgc;
    color:@fc;
  }
  &.hover,&:hover{
    background-color:if((@isLight),darken(@bgc,20%),lighten(@bgc,20%));
  }//hover事件,亮的变暗10%,暗的变亮10%;
  &.active,&:active{
    background-color:if((@isLight),lighten(@bgc,20%),darken(@bgc,20%));
  }//active事件和hover事件相反
  &.disabled,&:disabled{
    background-color:darken(#fff,30%);
    color:darken(#fff,50%);
  }//disabled禁用时变灰色;
}
.btn-color(@bgc:color(#333),@ftc:color(#fff),@brc:color(#333)){
  &{
    border-color:@brc;
    background-color:@bgc;
    color:@ftc;
  }
}


.btn-block(){
  display:block;
  width:100%;
}
.btn-size(@fz,@lh,@plr,@w){
  font-size:@fz;
  line-height:@lh;
  & when not (@w=0){width:@w;}
  & when not (@plr=0){
    padding-left:@plr;
    padding-right:@plr;
  }  
}

.button(){
  
}
.test(btn){
  .button();
}
.test(btn);


// .autoColor(@colorName,@colorValue,@prefix:~'-',@suffix:~''){
//   .text@{prefix}@{colorName}@{suffix}{
//     color:@colorValue;
//   }//字体颜色,前景色;
//   .bg@{prefix}@{colorName}@{suffix}{
//     background-color:@colorValue;
//   }//背景色;
//   .border@{prefix}@{colorName}@{suffix}{
//     border-color:@colorValue;
//   }//边框色;
//   .btn@{prefix}@{colorName}@{suffix}{
//     border-color:@colorValue;
    
//   }
// }
